const db = require('../db/index')

// 导入处理路径的 path 核心模块
const path = require('path')

// 添加购物车处理函数
exports.addGoodsCart = (req, res) => {

        db.query('select * from goods_carts', [req.body.id, req.params.name, req.params.imigUrl, req.params.price, req.params.num], (err, results) => {
        // if (err) return res.cc(err)

            db.query(`insert into goods_carts set ?`, req.body, (err, results) => {

            res.cc('新增购物车成功！', 0)
        })
    })
}